local cvar = cvar
local UI = UI

function GetCVar(name)
	return cvar.Get(name)
end

function GetCVarBool(name)
	local v = tonumber(cvar.Get(name))
	return v and v ~= 0
end

function GetCVarDefault(name)
	return cvar.GetDefault(name)
end

function GetCVarMin(name)
	return cvar.Get(name)
end

function GetCVarMax(name)
	return cvar.Get(name)
end

function SetCVar(name, value, script)
	cvar.Set(name, value)
	if script then
		UI.BroadcastEvent("CVAR_UPDATE", script, value)
	end
end

function RegisterCVar(name, value)
	cvar.Register(name, value)
end
